#ifndef RENDERER_H
#define RENDERER_H

#include "d3dUtil.h"
#include "DrawCall.h"

using namespace std;

namespace mgfx
{
	class Renderer
	{
	public:
		Renderer(){}
		~Renderer();

		void init(ID3D10Device * device);

		void setView(const XMFLOAT4X4 & view);
		void setProj(const XMFLOAT4X4 & proj);
		void setEyePos(const XMFLOAT3 & pos);

		void addModel(ModelDrawCall::Key key, ModelDrawCall * drawCall);
		void render();

	private:
		ID3D10Device * mDevice;

		XMFLOAT4X4 mCurrentView;
		XMFLOAT4X4 mCurrentProj;

		typedef ModelDrawCall ModelDC;
		typedef ModelDC::Key ModelKey;
		
		vector<pair<ModelKey, ModelDC*> > mModels;
	};

	extern Renderer * gRenderer;

}

#endif